package com.new_blog.mapper;

import com.new_blog.model.Userinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.new_blog.model.vo.UserInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author TQ02
 * @since 2024-03-21
 */
@Mapper
public interface UserinfoMapper extends BaseMapper<Userinfo> {

    @Select("select * from userinfo")
    List<Userinfo> getUserAll();

    @Select("select * from userinfo where uId=#{uId}")
    UserInfoVo getUser(String uId);

    //修改密码
    @Update("update userinfo set password=#{password2} where uId=#{uId}")
    int changepd(@Param("uId")String uId, @Param("password2")String password2);
}
